<template>
  <div>
    <div class="mHead">
      <el-image :src="vals" class="image" width="100%" height="100%" />
    </div>
    <div class="mName">
      <span
        class="mName2"
        >{{ movie.mname }}</span
      >
    </div>
    <div class="nick1">
      <span
        class="nick2"
        >{{ movie.nickname }}</span
      >
    </div>
    <div class="mT1">
      <el-tag type="warning" class="mT2">{{ movie.mlanguage }}</el-tag>
      <el-tag type="warning" class="mT2">{{ movie.mtype }}</el-tag>
      <el-tag type="warning" class="mT2"
        >{{ movie.duration }}分钟</el-tag
      >
    </div>
    <div class="mDirb">
      <span
        class="mDirb2"
        >导演：{{ movie.director }}</span
      >
    </div>
    <div class="mrb1">
      <span
       class="mrb2"
        >主演：{{ movie.mrole }}</span
      >
    </div>
  </div>
</template>
<script setup>
import axios from 'axios'
import { ElMessage } from 'element-plus'
import { ref, onMounted } from 'vue'
import emmitter from '@/utils/bus'
const movie = ref('')
const vals = ref()
onMounted(() => {
  const movieName = JSON.parse(sessionStorage.getItem('movieInfo'))
  axios.get('/api/movie/getMovieByMname/' + movieName).then((res) => {
    if (res.data !== null) {
      movie.value = res.data[0]
      vals.value = require('@/assets/moviesPic/' + res.data[0].pic)
      emmitter.emit('movieEvent', movie.value)
    } else {
      ElMessage({
        showClose: true,
        message: '网络错误！',
        type: 'error'
      })
    }
  })
})
</script>
<style lang="scss" scoped>
.mHead {
  width: 150px;
  height: 190px;
  margin-top: 1px;
  display: flex;
  float: left;
}
.mName{
  width: 100%; height: 50px
}
.mName2{
          font-size: large;
          color: white;
          display: flex;
          float: left;
          font-family: 'Arial Black';
}
.nick1{
  width: 100%; height: 40px
}
.nick2{
          font-size: small;
          color: white;
          display: flex;
          float: left;
          font-family: 'Arial Black';
}
.mT1{
  width: 100%; height: 40px
}
.mT2{
  margin-left: 2%; font-size: 10px
}
.mDirb{
  width: 100%; height: 40px
}
.mDirb2{
  font-size: small;
  display: flex;
  float: left;
  color: white;
  font-family: 'Arial Black';
}
.mrb1{
  width: 100%; height: 40px
}
.mrb2{
          font-size: small;
          display: flex;
          float: left;
          color: white;
          font-family: 'Arial Black';
}
</style>
